VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "HiResTimer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Private bhasHiResCounter As Boolean
Private timerFrequency As Currency
Private mStart As Currency
Private mStop As Currency

Sub Class_Initialize()
bhasHiResCounter = (QueryPerformanceFrequency(timerFrequency) <> 0)
End Sub

Public Sub Start()
QueryPerformanceCounter mStart
End Sub
Public Sub Halt()
QueryPerformanceCounter mStop
End Sub

Public Property Get Valid() As Variant
Valid = bhasHiResCounter
End Property


Public Property Get Elapsed() As Variant
Elapsed = (mStop - mStart) / (timerFrequency * 1#)
End Property

